package 内部类;

//外部类
public class Body {

    private int num1;

    public int getNum1() {
        return num1;
    }

    public void setNum1(int num1) {
        this.num1 = num1;
    }

    public Body() {
    }

    public Body(int num1) {
        this.num1 = num1;
    }

    //成员内部类
    public class Heart {
        public void heartmethod() {
            System.out.println("内部类的方法运行");
            System.out.println(num1);
        }
    }

    public void bodymethod() {
        System.out.println("外部类的方法");
        new Heart().heartmethod();

    }
}
